package org.example.sample1;

/**
 * @Title : ddd
 * @Description: :
 * @author: libo@juzishuke.com
 * @date: 2023/10/19 9:33
 * @Version:1.0
 */
public class TicketWindowRunnable implements Runnable {

    private int index = 1;//不做static修饰

    private final static int MAX = 500;

    @Override
    public void run() {

        while (index <= MAX) {
            System.out.println(Thread.currentThread() + " 的号码是:" + (index++));
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
